package com.swan.security.domain;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.List;

/** 自定义用户信息, 参考 org.springframework.security.core.userdetails.User
 * @author zongf
 * @date 2025-02-19
 **/
@Data
public class SecurityUserInfo implements UserDetails {

    private Long id;

    private String username;

    private String password;

    private List<GrantedAuthority> authorities;

    private boolean accountNonExpired = true;

    private boolean accountNonLocked = true;

    private boolean credentialsNonExpired = true;

    private boolean enabled = true;

    public SecurityUserInfo(Long id, String username, String password) {
        this.id = id;
        this.username = username;
        this.password = password;
    }

}
